import { login } from "../api/login";
let userInfo = JSON.parse(localStorage.getItem('userInfo'))||{}
const getters = {}
const state = {
    userInfo
}
const mutations = {
    login(state,val){
        state.userInfo = val.data
    }
}
const actions = {
    async login(content,val){
         const result = await login(val)
         content.commit('login',result)
         return result
    }
}

export default {
    getters,
    state,
    actions,
    mutations
}